package com.yq.light.feedback.code.service.impl;

import com.yq.light.feedback.code.dao.FeedbackDao;
import com.yq.light.feedback.code.service.FeedbackService;
import com.yq.light.commons.code.entity.Feedback;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("feedbackService")
@Transactional
@Slf4j
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackDao feedbackDao;

    /**
     * select feedback list
     *
     * @return
     */
    @Override
    public List<Feedback> feedbackList() {
        List<Feedback> list = feedbackDao.feedbackList();
        return list;
    }

    /**
     * 新建反馈
     *
     * @param feedback
     * @return
     */
    @Override
    public int newFeedback(Feedback feedback) {
        int result = 0;
        result = feedbackDao.newFeedback(feedback);
        return result;
    }
}
